<?php

namespace App\Models\Enum;

/**
 * 红包管理
 */
class RedPacket
{
    //打款类型
    const ZHI_FU_BAO = 1;

    //获取 状态名
    public static function getTypeName($type)
    {
        switch ($type) {
            case self::ZHI_FU_BAO:
                return '支付宝';
            default:
                return '类型未定义';
        }
    }

    // 打款状态
    const ALL = 0;
    const PENDING_PAYMENT = 1;
    const PAYMENT = 2;
    const REJECTED = 3;
    const PAYMENT_FAILED = 4;

    //获取 状态名
    public static function getStatName($stat)
    {
        switch ($stat) {
            case self::ALL:
                return '全部';
            case self::PENDING_PAYMENT:
                return '待打款';
            case self::PAYMENT:
                return '已打款';
            case self::REJECTED:
                return '已拒绝';
            case self::PAYMENT_FAILED:
                return '打款失败';
            default:
                return '类型未定义';
        }
    }

    //获取所有 打款状态
    public static function getAllStat()
    {
        return [
            self::ALL => self::getStatName(self::ALL),
            self::PENDING_PAYMENT => self::getStatName(self::PENDING_PAYMENT),
            self::PAYMENT => self::getStatName(self::PAYMENT),
            self::REJECTED => self::getStatName(self::REJECTED),
            self::PAYMENT_FAILED => self::getStatName(self::PAYMENT_FAILED),
        ];
    }
}